\documentclass{article}
\usepackage{tutor}

\begin{document}
Starting conversation...
\begin{python}
def say_hello():
    return r"Hello \LaTeX"
\end{python}
\LaTeX: Hello Python! 

Python: \py{say_hello()}

\LaTeX: Are you fine?

Python: \begin{python}
# python is a verbatim environment...
import random
answers = { 'rude': 'You bet!', 'polite': 'Yes, I\'m fine. And you?' }
k, v = random.choice(answers.items())
print v + ' (I am feeling %s)' % k
\end{python}

\LaTeX: I wonder how much is $1 + 1$.

Python: $1 + 1$ is $\py{1 + 1}$

\end{document}

